//
//  PlazaCollectionVIewCell.swift
//  NDAi
//
//  Created by 丸子 on 2024/6/4.
//

import UIKit

class PlazaCollectionViewCell: UICollectionViewCell {
     
    lazy var iconIV:UIImageView = {
       let view = UIImageView()
        view.image = UIImage(named: "ai_launch_logo")
        view.contentMode = .scaleAspectFit
        view.clipsToBounds = true
        return view
    }()
    
    lazy var titleLb: UILabel = {
       let label = UILabel()
        label.font = UIFont.pingFangSCMedium(ofSize: 16)
        label.textColor = Theme.color.text_d1
        label.text = ""
        label.textAlignment = .center
        return label
    }()
    
     lazy var descLb: UILabel = {
       let label = UILabel()
        label.font = UIFont.pingFangSCRegular(ofSize: 13)
        label.textColor = Theme.color.text_d3
        label.text = ""
        label.numberOfLines = 2
        label.textAlignment = .center
        return label
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        contentView.addSubviews([iconIV, titleLb, descLb])
        contentView.backgroundColor = UIColor.white
        contentView.allRound(8)
        iconIV.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(16)
            make.width.height.equalTo(78)
        }
        
        titleLb.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(iconIV.snp.bottom).offset(2)
            make.leading.trailing.equalToSuperview().inset(12)
        }
        
        descLb.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(titleLb.snp.bottom).offset(2)
            make.leading.trailing.equalToSuperview().inset(12)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
